# !/usr/bin/env python3.8
# -*- coding: utf-8 -*-
# @Time : 2021/7/15 17:05
# @Author : minvan
# @Email : jiangming8937@icloud.com
# @File : params.py
# @Software: PyCharm

import sys
import os
import json
import logging
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

def params(file_name):
    '''

    :param file_name: json文件名
    :return: 文件中的参数值
    '''
    jsonPath = os.path.abspath(os.path.join(os.getcwd(), ".."))+"/Params/data/"+file_name
    try:
        with open(jsonPath,'r') as json_file :
            logging.info("read json file %s"%file_name)
            data = json.load(json_file)
    except Exception as E:
        logging.warning(E)
    return data
